<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xml:lang="en" lang="en"
      xmlns:t="http://myfaces.apache.org/tomahawk">
<head>
    <title>Добавить новый элемент</title>
</head>
<body>
<h:form id="uploadForm" enctype="multipart/form-data">
<h:panelGrid columns="1">
<h:panelGroup rendered="#{uploaderbean.uploaded==false}">
    <t:inputFileUpload id="fileUpload" value="#{uploaderbean.uploadedFile}"/>
    <h:commandButton value="Загрузить" action="#{uploaderbean.uploadFile}">
    </h:commandButton>
</h:panelGroup>
    <h:panelGroup rendered="#{uploaderbean.uploaded==true}">
    <h:graphicImage value="/image?imagetmp=#{uploaderbean.smallImageName}" />
    </h:panelGroup>
        <h:outputText value="Название блюда:"/>
      <h:inputText value="#{uploaderbean.localElementName}"/>
    <h:outputText value="Название категории:" />
    <h:inputText value="#{uploaderbean.localCategoryName}"/>
    <h:outputText value="Описание блюда:"/>
    <h:inputText value="#{uploaderbean.localTextContent}"/>
    <h:outputText value="Цена:"/>
    <h:inputText value="#{uploaderbean.localPrice}"/>
    <h:panelGroup>
        <h:commandButton value="Сохранить" action="#{uploaderbean.saveElementInBD}"/>
        <h:commandButton value="Очистить" action="#{uploaderbean.eraseAll}"/>
        <h:commandButton value="Вернуться"/>
    </h:panelGroup>
</h:panelGrid>
</h:form>
</body>
</html>